<template>
  <router-layout>
    <div class="topicSele">
      <div class="title">
        <p class="iconfont icon-huati"></p>
        <p class="titleName">#话题广场#</p>
      </div>
      <div class="list">
        <div class="tipic" v-for="item in topicType" :key="item.id" @click="topicLink(item)">
          <p>#{{item.articletype_name}}#</p>
        </div>
      </div>
    </div>
  </router-layout>
</template>
<script>
import { article_listAllArticletype } from "@/api/article";
export default {
  name: "component_name",
  data() {
    return {
      topicType: ""
    };
  },
  methods: {
    topicLink(item) {
      this.$router.replace({
        path: "/CommunityTheme",
        query: {
          id: item.id,
          topicName: item.articletype_name
        }
      });
    },
    async topic() {
      //获取话题
      let { data } = await article_listAllArticletype();
      if (data.status == 100) {
        this.topicType = data.data.rows;
      }
    }
  },
  created: function() {
    this.topic();
  }
};
</script>
<style lang="scss" scoped>
.topicSele {
  background: #fff;
  padding: 20px 15px;
  .list {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
  }
  .tipic {
    background: #f9f9f9;
    border-radius: 14px;
    font-size: 12px;
    color: #01a0ef;
    padding: 0px 10px;
    margin-right: 5px;
    margin-bottom: 10px;
  }
  .title {
    display: flex;
    .icon-huati {
      color: #a0a0a0;
      font-size: 26px;
    }
    .titleName {
      font-size: 14px;
      margin-top: 3px;
      color: #191f25;
    }
  }
}
</style>
